package yag.battle.pet.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import yag.battle.pet.dao.EquipmentDao;
import yag.battle.pet.model.Equipment;

import java.util.List;

/**
 * Created by user on 31.08.2014.
 */
@Component
public class EquipmentService {
    @Autowired
    private EquipmentDao dao;

    public int create(Equipment equipment) {
        return dao.create(equipment);
    }

    public Equipment getById(int id) {
        return dao.getById(id);
    }

    public Equipment getByPetId(int id) {
        return dao.getByPetId(id);
    }

    public List<Equipment> getList() {
        return dao.getList();
    }

    public void updateNameById(int id, String name) {
        dao.updateNameById(id, name);
    }

    public void updateIdPetById(int id, int idPet) {
        dao.updateIdPetById(id, idPet);
    }

    public void deleteById(int id) {
        dao.deleteById(id);
    }

    public void deleteByPetId(int id) {
        dao.deleteByPetId(id);
    }

    public void deletePetIdById(int id) {
        dao.deletePetIdById(id);
    }

}
